﻿/*
----------------------------------------------
    Rodeo Game Engine
    This file is part of Rodeo Renderer Module
    GLLibrary.h - header file
    Copyright(c) Marcin Goryca
----------------------------------------------
*/
#ifndef RODEO_RENDERER_GLLIBRARY_H
#define RODEO_RENDERER_GLLIBRARY_H

#ifndef RODEO_GLLIBS_H_
#include "..\..\gllibs.h"
#endif

namespace rodeorenderer
{
    // Antialiasing 
    // NOT RECOMMENDED for performance
    bool lineAntialias();
    bool pointAntialias();
    bool polygonAntialias();

    //	
    // Polygon Rendering Modes 
    // Parameter	GLenum face - GL_FRONT	front of polygon will be rendered
    //			  GL_BACK	back of polygon will be rendered
    //				  GL_FRONT_AND_BACK	front and back will be rendered
    //	GLenum mode - GL_FILL	fill in all polygon(solid)
    //						  GL_LINE	polygon will be rendered with edges
    //						  GL_POINT	polygon will be rendered with points
    void polygonMode(GLenum face, GLenum mode);
    bool polyFrontFill();
    bool polyFrontLine();
    bool polyFrontPoint();
    bool polyFrontBackFill();
    bool polyFrontBackLine();
    bool polyFrontBackPoint();

    //	
    // Culling Modes	
    // Front - front side of the polygon will be culled\n
    // Back - back side of the polygon will be culled\n
    // Front and back	- all polygon will be culled\n
    bool cullFrontOn();
    bool cullBackOn();
    bool cullFrontBackOn();
    bool cullFrontOff();
    bool cullBackOff();
    bool cullFrontBackOff();
  
    //	
    // Winding Polygons
    // Default OpenGL mode is counterclockwise for front facing polygon\n
    // and clockwise for back facing polygon
    // Parameter GL_CCW - counterclockwise\n
    //           GL_CW - clockwise	
    bool polygonWinding(GLenum mode);

    // Edges to display
    // GLboolean  - GL_TRUE\n
    //              GL_FALSE
    bool polygonWithEdges(GLboolean edge);

    //	
    // Shade model
    // Parameter GLenum mode - GL_SMOOTH (default)\n
    //                         GL_FLAT	
    bool shadeMode(GLenum mode);
    bool lightingOn();
    bool lightingOff();

    // Enables / Disables Depth Test 
    bool depthTestOn();
    bool depthTestOff();
    bool scissorsOn();
    bool scissorsOff();
    bool stencilOn();
    bool stencilOff();
    void push();
    void pop();
    bool pointSize(float ps);
    bool lineWidth(float lw);

    // Light model
    // Parameter mode - GL_LIGHT_MODEL_AMBIENT
    // Parameter mode - GL_LIGHT_MODEL_LOCAL_VIEWER
    // Parameter mode - GL_LIGHT_MODEL_TWO_SIDE
    // Parameter mode - GL_LIGHT_MODEL_COLOR_CONTROL
    bool lightModel(GLenum mode, float r, float g, float b);
    bool colorMaterial();

    // Color material mode
    // Parameter face - GL_FRONT
    // Parameter face - GL_BACK
    // Parameter face - GL_FRONT_AND_BACK (default)
    // Parameter mode - GL_AMBIENT
    // Parameter mode - GL_DIFFUSE
    // Parameter mode - GL_SPECULAR,
    // Parameter mode - GL_AMBIENT_AND_DIFFUSE (defualt)
    // Parameter mode -  GL_EMISSION
    bool colorMaterialMode(GLenum face, GLenum mode);
    bool blendingOn();
    bool blendingOff();
    bool texturingOn();
    bool texturingOff();

    // How to draw geometry
    enum DrawingMode
    {
        RODEO_TRIANGLES = GL_TRIANGLES,
        RODEO_TRIANGLE_STRIP = GL_TRIANGLE_STRIP,
        RODEO_TRIANGLE_FAN = GL_TRIANGLE_FAN,
        RODEO_POINTS = GL_POINTS,
        RODEO_LINES = GL_LINES,
        RODEO_LINE_STRIP = GL_LINE_STRIP,
        RODEO_LINE_LOOP = GL_LINE_LOOP,
        RODEO_QUADS = GL_QUADS
    };

    // Lights
    enum LightType
    {
        RODEO_AMBIENT = GL_AMBIENT,
        RODEO_DIFFUSE = GL_DIFFUSE, 
        RODEO_SPECULAR = GL_SPECULAR,
    };

    // Data Types for rendering arrays
    enum DataTypes
    {
        RODEO_SHORT = GL_SHORT,
        RODEO_USHORT = GL_UNSIGNED_SHORT,
        RODEO_UINT = GL_UNSIGNED_INT,
        RODEO_FLOAT = GL_FLOAT,
        RODEO_DOUBLE = GL_DOUBLE,
        RODEO_BYTE = GL_BYTE,
        RODEO_INT = GL_INT,
        RODEO_UBYTE = GL_UNSIGNED_BYTE
    };

    // Viewport types supported by the engine
    enum GLViewportType 
    {
        RODEO_ORTHOGONAL = 0,
        RODEO_PERSPECTIVE = 1
    };

    // ArrayType enumeration
    // GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER
    enum ArrayType
    {
        RODEO_ARRAY = GL_ARRAY_BUFFER,
        RODEO_ELEMENT = GL_ELEMENT_ARRAY_BUFFER
    };

    // ArrayDraw enumeration
    // GL_STATIC_DRAW, GL_STREAM_DRAW, GL_DYNAMIC_DRAW
    enum ArrayDraw
    {
        RODEO_STATIC = GL_STATIC_DRAW,
        RODEO_STREAM = GL_STREAM_DRAW,
        RODEO_DYNAMIC = GL_DYNAMIC_DRAW
    };

    // BufferType enumeration
    // RODEO_VBO = VERTEX BUFFER OBJECT, 
    // RODEO_CBO = COLOR BUFFER OBJECT, 
    // RODEO_NBO = NORMAL BUFFER OBJECT, 
    // RODEO_TBO = TEXTURE BUFFER OBJECT, 
    // RODEO_EBO = ELEMENT BUFFER OBJECT
    enum BufferType
    {
        RODEO_VBO,
        RODEO_CBO,
        RODEO_NBO,
        RODEO_TBO,
        RODEO_EBO
    };
}    // end of rodeorenderer namespace
#endif    //RODEO_GLLIBRARY_H_
